/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.appspot.nnaplanner;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import java.net.URL;
import java.net.MalformedURLException;
import org.jgrapht.*;
import org.jgrapht.graph.*;


/**
 *
 * @author david rankin
 */

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class userTest {


    public userTest(){
        _id = -1;
        _name = "NA";
    }
    
    @PrimaryKey 
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private long _id;

    @Persistent
    private String _name;

    public DirectedGraph<URL, DefaultEdge> createHrefGraph(){
        DirectedGraph<URL, DefaultEdge> g = new DefaultDirectedGraph<URL, DefaultEdge>(DefaultEdge.class);

        try {
            URL amazon = new URL("http://www.amazon.com");
            URL yahoo = new URL("http://www.yahoo.com");
            URL ebay = new URL("http://www.ebay.com");

            // add the vertices
            g.addVertex(amazon);
            g.addVertex(yahoo);
            g.addVertex(ebay);

            // add edges to create linking structure
            g.addEdge(yahoo, amazon);
            g.addEdge(yahoo, ebay);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

        return g;
    }


}
